﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sharp.Domain.PlatformBoundedContext.MessageModule.Aggregates;

namespace Sharp.Domain.PlatformBoundedContext.ModelConfigurations
{
    public partial class MessageConfiguration
        : EntityTypeConfiguration<Message>
    {
        public MessageConfiguration()
        {
            HasKey(x => x.Id);

            Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();

            Property(t => t.Title)
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Summary)
                .HasMaxLength(150)
                .IsOptional();
            Property(t => t.Content)
                .IsMaxLength()
                .IsOptional();


            Property(t => t.CheckInTime)
                .IsRequired();
            Property(t => t.CheckInUserId)
                .IsRequired();
            Property(t => t.ModifiTime)
                .IsOptional();
            Property(t => t.ModifiedUserId)
                .IsOptional();

 
        }
    }
}

